package com.cc;

import com.cc.config.SpringConfig;
import com.cc.dao.HelloDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;

public class App {
    public static void main( String[] args ) {
        //创建spring容器
        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);

//        BaseDao baseDao = ctx.getBean(BaseDao.class);
//
//        baseDao.showDataBase();

//        HelloDao helloDao = ctx.getBean(HelloDao.class);
//
//        helloDao.showMy();

        DataSource dataSource = ctx.getBean(DataSource.class);

        System.out.println(dataSource);
    }
}
